local PLUGIN = {}
PLUGIN.Title = "Superman"
PLUGIN.Description = "Allows admins to turn on or off Superman serverside."
PLUGIN.Author = "Matt J"
PLUGIN.ChatCommand = "superman"
PLUGIN.Usage = "[1/0]"
PLUGIN.Privileges = { "Superman" }	

function PLUGIN:Call( ply, args )
	if ply:EV_HasPrivilege( "Superman" ) then
		if args[1] == "0" then
			game.ConsoleCommand( "superman_server_enabled 0\n" )
			evolve:Notify( evolve.colors.white, "Superman is now Off." )
			umsg.Start( "EV_Notify" )
				umsg.Short( 3 )
				umsg.String( "Superman Off" )
			umsg.End()
		else
			game.ConsoleCommand( "superman_server_enabled 1\n" )
			evolve:Notify( evolve.colors.white, "Superman is now On." )
			umsg.Start( "EV_Notify" )
				umsg.Short( 3 )
				umsg.String( "Superman On" )
			umsg.End()
		end
	else
		evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
	end
end

if ( CLIENT ) then
	usermessage.Hook( "EV_Notify", function( um )
		local time = um:ReadShort()
		local msg = um:ReadString()
		
		GAMEMODE:AddNotify( msg, NOTIFY_GENERIC, time )
		surface.PlaySound( "ambient/water/drip" .. math.random( 1, 4 ) .. ".wav" )
	end )
end

evolve:RegisterPlugin( PLUGIN )